package com.budwk.app.sqfwV2.service;

import com.budwk.app.sqfw.models.Sqfw_formSummary_new;
import com.budwk.app.sqfwV2.dto.PlaceParamDTO;
import com.budwk.app.sqfwV2.dto.dto.SqfwShopBaseInfoDTO;
import com.budwk.app.sqfwV2.dto.entity.SqfwShopsBaseInfo;
import com.budwk.app.sqfwV2.dto.vo.JurisdictionShopQueryVo;
import com.budwk.starter.common.page.Pagination;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.database.service.BaseService;
import org.nutz.mvc.upload.TempFile;

import java.util.List;

public interface ShopsBaseInfoService extends BaseService<SqfwShopsBaseInfo> {

    /**
     * 按照五级+商铺名称+地址新增或修改
     */
    SqfwShopsBaseInfo insertOrUpdateData(SqfwShopsBaseInfo shopsBaseInfo, Sqfw_formSummary_new formSummary);

    List<SqfwShopsBaseInfo> findByPlaceName(String placeName);
    List<SqfwShopsBaseInfo> listByCondition(String queryKey, String queryConent);


    /**
     * /**
     * 根据登录用户提供的场所查询数据
     *
     * @param content
     * @return
     */
    List<SqfwShopsBaseInfo> getShopInfoByPlaceName(String content, Integer pageSize, Integer pageNo, String type);

    /**
     * 后端管理获取商铺数据信息
     *
     * @param bean
     * @param pageNo
     * @param pageSize
     * @param pageOrderName
     * @param pageOrderBy
     * @return
     */
    Result<?> getShopInfoList(SqfwShopBaseInfoDTO bean, int pageNo, int pageSize, String pageOrderName, String pageOrderBy);

    /**
     * 导入商铺信息
     *
     * @param file
     */
    Result<?> importShopInfoData(TempFile file, String communityId);

    /**
     * 根据参数查询社区信息
     *
     * @param communityName
     * @return
     */
    Result<?> queryCommunity(String communityName);

    /**
     * 商铺模板下载
     */
    String downloadTemplate();

    /**
     * 当删除巡查记录时查看是否是最后一条记录然后删除手动添加的商铺信息
     */
    void deletedShopInfo(Sqfw_formSummary_new item);

    /**
     * 辖区商铺信息列表
     */
    Result<Pagination> listJurisdictionShop(JurisdictionShopQueryVo baseInfo);

    void changeCloseDown(String shopId);

    Sqfw_formSummary_new getShopDetailById(String shopId);

    /**
     * 商铺信息列表app 2.0
     * @param placeParamDTO
     * @return
     */
    Result<?> getPlaceInfoList(PlaceParamDTO placeParamDTO);

    /**
     * 保存场所/商铺信息 app 2.0
     * @param info
     * @return
     */
    SqfwShopsBaseInfo saveShopInfo(SqfwShopsBaseInfo info);

    /**
     * 更新商铺数据
     * @param info
     * @return
     */
    SqfwShopsBaseInfo updateShopInfo(SqfwShopsBaseInfo info);

    /**
     * 根据ID获取详情信息
     * @param id
     * @return
     */
    SqfwShopsBaseInfo getShopInfoDetail(String id);

    SqfwShopsBaseInfo findByDetailAddress(String detailAddress);

}
